package com.vii.brillien.core.component.chatty;

import com.vii.brillien.core.component.SuperPresence;
import com.vii.brillien.kernel.BrillienException;
import com.vii.brillien.kernel.annotations.PresenceService;
import com.vii.brillien.kernel.annotations.lifecycle.Resident;

@PresenceService
@Resident
public class Alice extends SuperPresence {

    public void palaver() throws BrillienException {
        String answer = sendGet("Bob", "hello", null).<String>getResponse();
        System.out.println("ANSWER::::::::" + answer );
    }

    public void whisper() throws BrillienException {
        String answer = sendGet("Bob", "delegateplease", null).<String>getResponse();
        System.out.println("Whisper ANSWER::::::::" + answer );
    }

    public void makeNoise() throws BrillienException {
        try{
            String answer = sendGet("Bob", "deceivingPlan", null).<String>getResponse();
        } catch (Exception e){
            System.out.println("Error message received properly!");
        }
    }

}
